#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button = new QPushButton(this);
    button->setText("hello world");
    //connect(button, &QPushButton::clicked,this,&Widget::func);


    connect(this, &Widget::mysignal, this, &Widget::func);
    mysignal();

}

Widget::~Widget()
{
    delete ui;
}

void Widget::func()
{
    setWindowTitle("Title");
}

//void Widget::close()
//{
    //->close();
//}


void Widget::on_pushButton_clicked()
{
    setWindowTitle("nnn");
}
